/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (C) 2014 RayBow and/or its affiliates. All rights reserved.
 */
package top.swimmer.core.dao;

import org.apache.ibatis.annotations.Param;
import top.swimmer.core.model.options.page.Pageable;
import top.swimmer.core.model.result.Results;

import java.util.List;

/**
 * BaseMapper.
 */
public interface BaseMapper<T> extends WindstormMapper {
    void create(@Param("entity") T entity);

    T get(@Param("id") Integer id);

    void update(@Param("id") Integer id, @Param("entity") T entity);

    void delete(@Param("id") Integer id);

    boolean exists(@Param("id") Integer id);

    List<T> getAll();

    Results<T> getAllByPagination(@Param("options") Pageable options);

    List<T> batchGet(@Param("ids") List<Integer> ids);

    List<String> getAutoSuggestNames();

    void batchCreate(@Param("entities") List<T> entities);

    void bulkCreate(@Param("entities") List<T> entities);

    void batchUpdate(@Param("entities") List<T> entities);
}
